<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
	<h4 class="modal-title" id="exampleModalLabel">
			${empty vo?'新增学科':'编辑学科'}
	</h4>
</div>
<form id="save-form" class="form-horizontal" method="post"
	  action="${pageContext.request.contextPath}/basic/subject/save.do">
	<div class="modal-body" style="min-height:200px;height:auto;">
		<input type="hidden"  value="${vo.id}" name="id" id="id"/>
		<input type="hidden"  value="${scheduleId}" name="scheduleId" />
		<input type="hidden"  value="${schoolId}" name="schoolId" />
		<div class="row form-group">
			<div class="col-md-3 control-label">
				<label>学科编号</label>
			</div>
			<div class="col-md-6 controls">
				<input type="text" id="number" name="number" class="form-control inputStart" value="${vo.number}"/>
			</div>
		</div>

		<div class="row form-group">
			<div class="col-md-3 control-label">
				<label>学科名称</label>
			</div>
			<div class="col-md-6 controls">
				<input type="text" id="name" name="name" class="form-control inputStart" value="${vo.name}"/>
			</div>
		</div>

	</div>


	<div class="modal-footer">
		<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		<button type="submit" class="btn btn-primary">确认</button>
	</div>
</form>

<script type="text/javascript"
		src="${pageContext.request.contextPath}/assets/js-lib/bootstrap-Validation/dist/js/bootstrapValidator.js" charset="UTF-8"></script>

<script type="text/javascript">



	if($("#id").val()!=""){
     /*   $("#customerId").find("option[value='"+_customerId+"']").attr("selected",true);*/
	    $("#type").find("option[value='"+$(".orgAcadYear").val()+"']").attr("selected",true);
        $("#semester").find("option[value='"+$(".orgSemester").val()+"']").attr("selected",true);
	}
    $('#save-form').bootstrapValidator({
        //        live: 'disabled',
        message: '值不合法',
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {

            name: {
				/* group : '.col-sm-4', */
                validators: {
                    notEmpty: {
                        message: '学科名称不能为空'
                    }
                }
            },
            number: {
				/* group : '.col-sm-4', */
                validators: {
                    notEmpty: {
                        message: '学科编号不能为空'
                    },
                remote : {
                    type : 'POST',
                    message : '编号已被使用',
                    url:'${pageContext.request.contextPath}/basic/subject/checkSub.do?id=${vo.id}',
                    delay:800
                }
                }
            }


        }
    });



</script>
